import { axios } from '@/utils/request'

export function getPatient (id, department) {
  return axios({
    url: '/patient',
    method: 'get',
    params: {
      'id': id,
      'department': department
    }
  })
}
export function getPatientByNurse (nurse, role, department) {
  return axios({
    url: '/patient/nurse',
    method: 'get',
    params: {
      'nurse': nurse,
      'role': role,
      'department': department
    }
  })
}
export function delPatient (id) {
  return axios({
    url: '/patient',
    method: 'delete',
    params: {
      'id': id
    }
  })
}

export function outPatient (id) {
  return axios({
    url: '/patient/out',
    method: 'get',
    params: {
      'id': id
    }
  })
}

export function addPatient (patient) {
  return axios({
    url: '/patient',
    method: 'post',
    data: patient
  })
}

export function updatePatient (patient) {
  return axios({
    url: '/patient/update',
    method: 'post',
    data: patient
  })
}
export function savePatient (patient) {
  return axios({
    url: '/patient/save',
    method: 'post',
    data: patient
  })
}
export function getByName (name) {
  return axios({
    url: '/patient/query',
    method: 'get',
    params: {
      'name': name
    }
  })
}
export function addAdvice (advice) {
  return axios({
    url: '/patient/advice',
    method: 'post',
    data: advice
  })
}

export function doAdvice (id) {
  return axios({
    url: '/patient/advice/do',
    method: 'get',
    params: {
      id: id
    }
  })
}
export function getPatientByWard (number) {
  return axios({
    url: '/patient/ward',
    method: 'get',
    params: {
      'number': number
    }
  })
}
